I've been on the internet since 1995, only once in all that time has porn appeared on my browser without me wanting it there. I was on dodgy sites looking for pirated stuff sometime in those early years and my browser got hijacked by some malicious shit that is often found on those type of sites (lesson learned) and I ended up frantically chasing the browser windows around trying to close them faster than they appeared. In less than 30 seconds i unplugged and rebooted in safe mode and did full scans to remove the malware and viruses i had allowed onto my PC. It did take several hours and repeated efforts to try and clean it, I'm pretty sure i failed to fully remove it and rather than risk a repeat i scrubbed the hard drive (full 0 fill) and went back to an earlier image of my disk.
That is the only time porn has accidentally appeared on my computer in 20+ years on the internet. It does not just jump out at you from nowhere.